﻿using System;
using Engine;
using Microsoft.Xna.Framework;

using ThinkDotNetEditorLib;
using ThinkDotNetEditorLib.Models;
using ThinkDotNetEditorLib.Services.DialogWindowService;

namespace ThinkDotNetEditor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            var shell = new ShelForm();
            shell.Show();        

            using (GameEditor game = new GameEditor(shell.XnaContainer))
            {
                ServiceLocator.Instance.RegisterType(typeof (IDialogWindowService), typeof (DialogWindowService));                
                ServiceLocator.Instance.RegisterType(typeof (IWorldLoader), typeof (WorldLoader));
                ServiceLocator.Instance.RegisterInstance(typeof(IGameEditor), game);
                ServiceLocator.Instance.RegisterInstance(typeof (Arena), new Arena(game));
                shell.GameEditor = game;
                game.Run();

            }
        }
    }
}
